#ifndef OGRECONTEXT_H
#define OGRECONTEXT_H

#include <Ogre.h>

#include <QString>
#include <QWindow>
#include <QObject>

class OgreContext: public QObject
{
public:
	OgreContext(const QString& appName = "Ogre3D");

	void setup();
	bool initContext(QWindow* window,QString pluginFilePath);

	Ogre::Root*			getRoot();
	Ogre::RenderWindow* getRenderWindow();

private:
	Ogre::RenderWindow* createWindow(const QString& name,unsigned int w = 0, unsigned int h = 0,
		Ogre::NameValuePairList miscParams = Ogre::NameValuePairList());
	void updateScene();
	bool eventFilter(QObject* obj, QEvent* event) override;
	
	QString m_sAppName;

	QWindow*	m_pQWindow;
	Ogre::Root* m_pOgreRoot;
	Ogre::RenderWindow* m_pRenderWindow;
};


#endif
